package cn.com.twoke.game.client.games;

import cn.com.twoke.game.client.games.framework.core.Game;

import java.util.function.Function;

public class GameConfig {

    private String id;
    private String title;
    private Function<CreateGameContext, Game> game;
    private int maxPlayers;
    private int minPlayers;

    public static class CreateGameContext {
        private int playerCount;

        public CreateGameContext(int playerCount) {
            this.playerCount = playerCount;
        }

        public int getPlayerCount() {
            return playerCount;
        }

        public void setPlayerCount(int playerCount) {
            this.playerCount = playerCount;
        }
    }



    public GameConfig(String id, String title, Function<CreateGameContext, Game> game, int maxPlayers, int minPlayers) {
        this.id = id;
        this.title = title;
        this.game = game;
        this.maxPlayers = maxPlayers;
        this.minPlayers = minPlayers;
    }

    public int getMaxPlayers() {
        return maxPlayers;
    }

    public void setMaxPlayers(int maxPlayers) {
        this.maxPlayers = maxPlayers;
    }

    public int getMinPlayers() {
        return minPlayers;
    }

    public void setMinPlayers(int minPlayers) {
        this.minPlayers = minPlayers;
    }

    public Function<CreateGameContext, Game> getGame() {
        return game;
    }

    public void setGame(Function<CreateGameContext, Game> game) {
        this.game = game;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}
